<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<title>Unicorn Admin</title>
		<meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link rel="stylesheet" href=" ${pageContext.request.contextPath}/dist/css/bootstrap-min.css" />
		<link rel="stylesheet" href="${pageContext.request.contextPath}/dist/css/bootstrap-responsive.min.css" />
		<link rel="stylesheet" href="${pageContext.request.contextPath}/dist/css/unicorn.main.css" />
		<link rel="stylesheet" href="${pageContext.request.contextPath}/dist/css/unicorn.grey.css" class="skin-color" />	
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
	<body>	
		<div id="header">
			<h1><a href="./dashboard.html">独角兽管理员</a></h1>		
		</div>
		
		<div id="user-nav" class="navbar navbar-inverse">
            <ul class="nav btn-group">
                <!-- <li class="btn btn-inverse"><a title="" href="#"><i class="icon icon-user"></i> <span class="text">Profile</span></a></li>
                <li class="btn btn-inverse dropdown" id="menu-messages"><a href="#" data-toggle="dropdown" data-target="#menu-messages" class="dropdown-toggle"><i class="icon icon-envelope"></i> <span class="text">Messages</span> <span class="label label-important">5</span> <b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li><a class="sAdd" title="" href="#">new message</a></li>
                        <li><a class="sInbox" title="" href="#">inbox</a></li>
                        <li><a class="sOutbox" title="" href="#">outbox</a></li>
                        <li><a class="sTrash" title="" href="#">trash</a></li>
                    </ul>
                </li>
                <li class="btn btn-inverse"><a title="" href="#"><i class="icon icon-cog"></i> <span class="text">Settings</span></a></li> -->
                   <!-- 默认头像 -->					
					<li><img src="${pageContext.request.contextPath}/dist/img/0.jpg"
					     style="border-radius:50%;width:30px;height:30px;margin-top:0px;"/></li>
					<%-- </c:if>
					<!-- 自定义头像 -->
					<c:if test="${sessionScope.users.adminImg != null} }">
					<li><img src="${pageContext.request.contextPath}/DownloadFileServlet?fileName=${sessionScope.users.adminImg}"
					     style="border-radius:50%;width:30px;height:30px;margin-top:0px;"/></li>
					</c:if> --%>
                <li><a href="#">${sessionScope.users.adminAccount }</a></li>
                <li class="btn btn-inverse"><a title="" href="${pageContext.request.contextPath}/EduControllerByGyx?op=addminExit"><i class="icon icon-share-alt"></i> <span class="text">退出</span></a></li>
            </ul>
        </div>
         <!--左侧导航栏 -->
		<div id="sidebar">
			<a href="#" class="visible-phone"><i class="icon icon-home"></i> 首页</a>
			<ul>
				<li class="active"><a href="${pageContext.request.contextPath}/mvc/index.jsp"><i class="icon icon-home"></i> <span>首页</span></a></li>
				<li class="submenu">
					<a href="#"><i class="icon icon-th-list"></i> <span>管理员事项</span> <span class="label">2</span></a>
					<ul>
						<li><a href="${pageContext.request.contextPath}/mvc/form-validation.jsp">管理员列表</a></li>
						<li><a href="${pageContext.request.contextPath}/mvc/form-addadmin.jsp">添加管理员</a></li>
					</ul>
				</li>
				<li class="submenu">
					<a href="#"><i class="icon icon-th-list"></i> <span>详细数据表</span> <span class="label">2</span></a>
					<ul>
						<li><a href="${pageContext.request.contextPath}/mvc/userstable.jsp">用户列表</a></li>
						<li><a href="${pageContext.request.contextPath}/mvc/articletable.jsp">文章列表</a></li>
					</ul>
				</li>
				<li>
					<a href="${pageContext.request.contextPath}/mvc/charts.jsp"><i class="icon icon-signal"></i> <span>数据信息统计</span></a>
				</li>		
			</ul>
		</div>
		
		<div id="style-switcher">
			<i class="icon-arrow-left icon-white"></i>
			<span>Style:</span>
			<a href="#grey" style="background-color: #555555;border-color: #aaaaaa;"></a>
			<a href="#blue" style="background-color: #2D2F57;"></a>
			<a href="#red" style="background-color: #673232;"></a>
		</div>
		<!-- 中间主页面 -->
		<div id="content">
			<div id="content-header">
				<h1>EduSystem系统</h1>
			</div>
			<div id="breadcrumb">
				<a href="index.jsp" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> 主页面</a>
				<a href="#" class="current">添加管理员</a>
			</div>
			<div class="container-fluid">
				<div class="row-fluid">
					<div class="span12">
						<div class="widget-box">
							<div class="widget-title">
								<span class="icon">
									<i class="icon-pencil"></i>
								</span>
								<h5>请填写相关信息</h5>
							</div>
							<div class="widget-content nopadding">
								<form id="form-wizard" class="form-horizontal" method="post" action="${pageContext.request.contextPath}/EduControllerByGyx?op=addAdmin">
									<div id="form-wizard-1" class="step">
										<div class="control-group">
											<label class="control-label">管理员账号</label>
											<div class="controls">
												<input id="adminAccount" type="text" name="adminAccount" placeholder=" " required autofocus/>
											    <label id="account-hint"></label>
											</div>
										</div>
										<div class="control-group">
											<label class="control-label">管理员密码</label>
											<div class="controls">
												<input id="password" type="password" name="password" placeholder="至少6个字符" required />
												<label id="pwd-hint"></label>
											</div>
										</div>
										<div class="control-group">
											<label class="control-label">确认密码</label>
											<div class="controls">
												<input id="re-password" type="password" name="re-password" />
											    <label id="repwd-hint"></label>
											</div>
										</div>
										
									</div>
									<!-- <div id="form-wizard-2" class="step">
										<div class="control-group">
											<label class="control-label">管理员头像</label>
											<div class="controls">
												<input type="file" id="adminImg" name="adminImg" class="form-control">
											    <label></label>
											</div>
										</div>										
									</div> -->
									<div class="form-actions">
											<input id="back" class="btn btn-info" type="reset" value="清空" />
											<input id="next" class="btn btn-primary" type="submit" value="确认添加" />
											<div id="status"></div>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>
				
				<div class="row-fluid">
					<div id="footer" class="span12">
						2012 &copy; Unicorn Admin. Brought to you by <a href="https://wrapbootstrap.com/user/diablo9983">diablo9983</a>
					</div>
				</div>
			</div>
		</div>
		        
            <script src="${pageContext.request.contextPath}/distjs/jquery.min.js"></script>
            <script src="${pageContext.request.contextPath}/distjs/jquery.ui.custom.js"></script>
            <script src="${pageContext.request.contextPath}/distjs/bootstrap-min.js"></script>
            <script src="${pageContext.request.contextPath}/distjs/jquery.validate.js"></script>
            <script src="${pageContext.request.contextPath}/distjs/jquery.wizard.js"></script>
            <script src="${pageContext.request.contextPath}/dist/js/unicorn.js"></script>
            <script src="${pageContext.request.contextPath}/distjs/unicorn.wizard.js"></script>
	</body>
	 <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
	<script>
	 $(function  () {	              
         //失去焦点时触发
          $("#adminAccount").blur(function(){
       	 var adminAccount =$(this).val();
       	 if(adminAccount ==""){
       		 $("#account-hint").text("账号不能为空");
       	 }else{
       		 $("#account-hint").text("正确");
       	 }
         });
          //判断密码长度大于6,不能包含空格
		  $("#password").blur(function(){
			  if( $("#password").val().trim().length >= 6  &&  $("#password").val().trim().indexOf(" ") == -1){		    				 
				  $("#pwd-hint").text("正确");
			  }else{
				  $("#pwd-hint").text("密码长度大于6,不能包含空格");
			  }
		  });
		  //验证确认密码
		   $("#re-password").blur(function(){
			 var pwd=$("#password").val();
			 var repwd=$("#re-password").val();
			 if(pwd != repwd){
				 $("#repwd-hint").text("两次密码不一致");
			 }else{
				 $("#repwd-hint").text("两次密码一致");
			 }
			 
		   });
		  
		  //清空按钮点击事件
		 /*  $("#back").click(function(){
			  $("#account-hint").val("");
			  $("#repwd-hint").val("");
			  $("#repwd-hint").val("");
			  
		  }); */
		   //最终的提交表单
		     
   		  $("#form-wizard").submit(function(){
   			  if($("#account-hint").text("正确") && $("#pwd-hint").text()=="正确" &&  $("#repwd-hint").text()=="两次密码一致"){
   				 return true;
   			  }
   			  return false;
   		  });  
	}) 
   </script>
</html>
